package cn.javass.framework.ioc.core;

import cn.javass.framework.ioc.core.impl.AnnotationBeanFactory;

public class ApplicationContext {
	private static ApplicationContext appCtx ;
	private static BeanFactory bf = null; 
	
	private ApplicationContext(){
		bf = new AnnotationBeanFactory();
	}
	
	public static ApplicationContext getCtx(){
		if(appCtx == null){
			synchronized (ApplicationContext.class) {
				if(appCtx == null){
					appCtx = new ApplicationContext();
				}
			}
		}
		return appCtx;
	}
	
	
	public Object getBean(String beanId){
		return bf.getBean(beanId);
	}
}
